package com.ruoyi.sl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlFixedSalaryMapper;
import com.ruoyi.sl.domain.SlFixedSalary;
import com.ruoyi.sl.service.ISlFixedSalaryService;

/**
 * 固定薪水Service业务层处理
 * 
 * @author admin
 * @date 2024-06-10
 */
@Service
public class SlFixedSalaryServiceImpl implements ISlFixedSalaryService
{
    @Autowired
    private SlFixedSalaryMapper slFixedSalaryMapper;

    /**
     * 查询固定薪水
     * 
     * @param fsId 固定薪水主键
     * @return 固定薪水
     */
    @Override
    public SlFixedSalary selectSlFixedSalaryByFsId(Long fsId)
    {
        return slFixedSalaryMapper.selectSlFixedSalaryByFsId(fsId);
    }

    /**
     * 查询固定薪水
     *
     * @param userName 用户名
     * @return 固定薪水
     */
    @Override
    public SlFixedSalary selectSlFixedSalaryByUserName(String userName)
    {
        return slFixedSalaryMapper.selectSlFixedSalaryByUserName(userName);
    }

    /**
     * 查询固定薪水列表
     * 
     * @param slFixedSalary 固定薪水
     * @return 固定薪水
     */
    @Override
    public List<SlFixedSalary> selectSlFixedSalaryList(SlFixedSalary slFixedSalary)
    {
        return slFixedSalaryMapper.selectSlFixedSalaryList(slFixedSalary);
    }

    /**
     * 新增固定薪水
     * 
     * @param slFixedSalary 固定薪水
     * @return 结果
     */
    @Override
    public int insertSlFixedSalary(SlFixedSalary slFixedSalary)
    {
        slFixedSalary.setCreateTime(DateUtils.getNowDate());
        return slFixedSalaryMapper.insertSlFixedSalary(slFixedSalary);
    }

    /**
     * 修改固定薪水
     * 
     * @param slFixedSalary 固定薪水
     * @return 结果
     */
    @Override
    public int updateSlFixedSalary(SlFixedSalary slFixedSalary)
    {
        slFixedSalary.setUpdateTime(DateUtils.getNowDate());
        return slFixedSalaryMapper.updateSlFixedSalary(slFixedSalary);
    }

    /**
     * 批量删除固定薪水
     * 
     * @param fsIds 需要删除的固定薪水主键
     * @return 结果
     */
    @Override
    public int deleteSlFixedSalaryByFsIds(Long[] fsIds)
    {
        return slFixedSalaryMapper.deleteSlFixedSalaryByFsIds(fsIds);
    }

    /**
     * 删除固定薪水信息
     * 
     * @param fsId 固定薪水主键
     * @return 结果
     */
    @Override
    public int deleteSlFixedSalaryByFsId(Long fsId)
    {
        return slFixedSalaryMapper.deleteSlFixedSalaryByFsId(fsId);
    }
}
